<?php

/**
 * MVM_MALL 网上商店系统  后台登陆
 * ============================================================================
 * 版权所有 (C) 2007-2010 www.mvmmall.com，并保留所有权利。
 * 网站地址: http://www.mvmmall.com
 * ----------------------------------------------------------------------------
 * 这是一个免费开源的软件；这意味着您可以在不用于商业目的的前提下对程序代码
 * 进行修改、使用和再发布。
 * ============================================================================
 * $Author:  www.mvmmall.com  $
 * $Date: 2008-02-27 $
 * $Id: login.inc.php www.mvmmall.com$
 * ---------------------------------------------
*/

if(!defined('MVMMALL')) exit('Access Denied');
if($m_check_id && $admincp_login==1){
    move_page('admincp.php?module=index');
 }elseif ($m_check_id){
     $disabled='disabled';
 }else {
     $disabled='';
 }
 if($setp==1 && $_POST){
     //登陆验证码判断
     if($mm_login_code==1){
         require_once 'include/captcha.class.php';
         $Captcha= new  Captcha();
         if(!$Captcha->CheckCode($code)){
            admin_msg('code_wrong');
         }
     }
     $login_pass = md5(dhtmlchars($login_pass));
     $login_id   = dhtmlchars($login_id);
     if (!$m_check_id){
         require_once 'include/passport.inc.php';
     } else {
          $admincp_list = $db->get_one("SELECT member_id,member_pass FROM `{$tablepre}member_table` WHERE member_id='$m_check_id' AND member_pass='$login_pass'");
          if ($admincp_list['member_id']==$m_check_id && $admincp_list['member_pass']==$login_pass){
               $_SESSION['user']['mvm_admincp_login'] = 1;
               move_page('admincp.php?module=index');
          }else {
               move_page('admincp.php?module=index');
               exit;
          }
     }
 }
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Language" content="zh-cn"/>
<meta name="author" content="南南 || www.mvmmall.com"/>
<meta name="copyright" content="MVM mall关注购物未来"/>
<meta name="keywords" content="MVM mall关注购物未来"/>
<meta name="description" content="做最好最快最漂亮的网上商店系统、网店系统平台，软件PHP程序，商城模板，提供全系列电子商务、网络购物软件,在线购物、网上购物软件均提供在线下载和免费试用"/>
<meta content="电子商务、网店、网络购物、网上购物、在线购物、网上商城、网上商店、免费软件、网上开店、网上支付"/>
<title>登录后台管理</title>
<style type="text/css">
body
{
	margin: 0;
	padding: 0;
	font: 12px Verdana;
	color: #000000;
	background: #f5f5f5;
	text-align: center;
}
form
{
	margin: 0;
	padding: 0;
}
div
{
	font: 12px Verdana;
	text-align: left;
}
.text
{
	border: 1px solid #ffffff;
	width: 156px;
	font: 12px Verdana;
	color: #1065ac;
}
.inp
{
	border: 1px solid #ffffff;
	font: 12px Verdana;
	color: #1065ac;
	width: 70px;
}
.button
{
	font: bold 12px Verdana;
	color: #ffffff;
	background: #1065ac;
	border: 1px solid #1065ac;
	cursor: pointer;
}
#main
{
	margin: 80px auto 0 auto;
	width: 600px;
	height: 400px;
	background: #e0e0e0;
}
#header
{
	padding: 3px;
	color: #ffffff;
	background: #1065ac;
	font: bold 17px Verdana;
}
#title
{
	padding: 10px 0 10px 10px;
	color: #1065ac;
	background: #ffffff;
	font-weight: bold;
	border-bottom: 1px solid #c0c0c0;
}
#content
{
	height: 300px !important;
	height: 305px;
	border-top: 1px solid #ffffff;
	border-bottom: 1px solid #c0c0c0;
}
#content_left
{
	float: left;
	width: 200px;
	height: 250px;
}
#content_left img
{
	margin: 10px;
}
#content_right
{
	float: left;
	margin-top: 10px;
	width: 390px !important;
	width: 380px;
	height: 230px;
	background: #a8a8a8;
}
#content_right table
{
	margin: 50px 0 0 10px;
	color: #ffffff;
	font: 12px Verdana;
}
#footer
{
	padding: 10px 10px 10px 0;
	border-top: 1px solid #ffffff;
	font: bold 11px Verdana;
	text-align: right;
	color: #1065ac;
}
</style>
<script type="text/javascript">
function check_main_login()
{
	var m=document.mvmmall_main_login;
	if(m.login_id.value.length=="")
	{
		alert("请输入ID");
		m.login_id.focus();
		return false;
	}
	if(m.login_pass.value.length=="")
	{
		alert("请输入密码");
		m.login_pass.focus();
		return false;
	}
}
function pressCaptcha(obj)//字母变大写
  {
    obj.value = obj.value.toUpperCase();
  }
</script>
</head>
<body>
<div id="main">
	<div id="header">MvMmall</div>
	<div id="title">Manager Login</div>
	<div id="content">
		<div id="content_left"><img width="179" height="229" src="images/admincp/splash.jpg" alt="splash"/></div>
		<div id="content_right">
		<form method="post" action="" name="mvmmall_main_login" onSubmit="javascript: return check_main_login()">
		<input type="hidden" name="action" value="login"/>
		<input type="hidden" name="referer" value="admincp.php?module=index"/>
		<input type="hidden" name="setp" value="1"/>
		<table cellpadding="2" cellspacing="0" border="0" width="100%">
		<tbody>
		<tr>
		<td colspan="2" height="30">请输入管理员帐号及密码：</td>
		</tr>
		<tr>
		<td align="right"><strong>管理员帐号:</strong></td>
		<td><input type="text" name="login_id" class="text" value="<?php echo  $m_check_id?>" <?php echo  $disabled?>/></td>
		</tr>
		<tr>
		<td align="right"><strong>管理员密码:</strong></td>
		<td><input type="password" name="login_pass" class="text"/></td>
		</tr>
		<?php if($mm_login_code==1){?>
		<tr>
		<td align="right"><strong>验证码:</strong></td>
		<td><input name="code" onKeyUp="pressCaptcha(this)" type="text" class="inp" id="code" size="6" maxlength="8" />
		<img align="absbottom" src="ajax.php?action=code"  onclick=this.src="ajax.php?action=code&"+Math.random() style="cursor: pointer;" title="看不清？点击更换验证码。"/>
		</td>
		</tr>
		<?php }?>
		<tr>
		<td></td>
		<td><input type="submit" value="Login" class="button"/></td>
		</tr>
		</tbody>
		</table>
		</form>
		</div>
	</div>
	<div id="footer"><?php echo $lang_powered_mvmmall.$mvm_spend; ?></div>
</div>
</body>
</html>
